package com.foreverwin.mes.production.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.production.model.ResourceInventoryLog;
import com.foreverwin.mes.production.mapper.ResourceInventoryLogMapper;
import com.foreverwin.mes.production.service.ResourceInventoryLogService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 * 设备库存上料卸料记录 服务实现类
 * </p>
 *
 * @author Ervin Chen
 * @since 2020-02-04
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ResourceInventoryLogServiceImpl extends ServiceImpl<ResourceInventoryLogMapper, ResourceInventoryLog> implements ResourceInventoryLogService {


    @Autowired
    private ResourceInventoryLogMapper resourceInventoryLogMapper;

    @Override
    public Page<ResourceInventoryLog> selectPage(FrontPage<ResourceInventoryLog> frontPage, ResourceInventoryLog resourceInventoryLog) {
        EntityWrapper<ResourceInventoryLog> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(resourceInventoryLog);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<ResourceInventoryLog> selectList(ResourceInventoryLog resourceInventoryLog) {
        EntityWrapper<ResourceInventoryLog> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(resourceInventoryLog);
        return super.selectList(queryWrapper);
    }


}